package com.jt.web.controller;

import com.jt.web.Vo.SysResult;
import com.jt.web.pojo.User;
import com.jt.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("login")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("login")
    public SysResult doLogin(@RequestBody User user){
        String token = userService.Login(user);
        if(token == null)
            return null;
        return SysResult.success();
    }



}
